package com.ten.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ten.mapper.ParkMapper;
import com.ten.pojo.Park;
import com.ten.pojo.ParkExample;
import com.ten.service.ParkService;
@Service
@Transactional
public class ParkServiceImpl implements ParkService {
	@Autowired
	private ParkMapper parkMapper;
	@Override
	public int savePark(List<Park> parks) {
		int i=0;
		if(parks!=null){
		for(Park record :parks){
			parkMapper.insert(record);
			i++;
		}
		}
		return i;
	}
	@Override
	@Transactional(readOnly=true)
	public List<Park> findAll() {
		ParkExample example =new ParkExample();
		List<Park> list =parkMapper.selectByExample(example);
		return list;
	}

}
